package edu.ccut.saturn.workflow.finishTaskModule.code;

import java.text.SimpleDateFormat;

import edu.ccut.saturn.component.DefaultComponent;
import edu.ccut.saturn.component.IParameterContext;


public class GetTimeoutNumber  extends DefaultComponent {
	public void execute(IParameterContext parameterContext) throws Exception {
		String final_time = (String)parameterContext.getParameterValue(0);
		String end_time = (String)parameterContext.getParameterValue(1);
		SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Long timeout_number = format.parse(end_time).getTime() - format.parse(final_time).getTime();
		
		parameterContext.setParameter(2, timeout_number);
	}

}
